/************************************************************
* author: alexander.aivars <alexander.aivars&#64;svt.se>
* $Date:2007-12-19 11:39:12 +0100 (Wed, 19 Dec 2007) $
* $Revision:196 $
* $HeadURL:svn://stoiis03.internt.svt.se/SVTiFLASH/trunk/SVTSE/Source/Classes/se/svt/web/models/XMLDBData.as $
* $Id:XMLDBData.as 196 2007-12-19 10:39:12Z alai $
************************************************************/
package se.svt.web.models
{
	import flash.events.IEventDispatcher;
	import se.svt.web.models.NetData;

	public class XMLDBData extends NetData
	{
		private var _articleId:int = -1;
		private var _departmentId:int = -1;
		private var _userId:String;
		private var _data:String;
		private var _state:int = 1;
		private var _dataHashkey:String;
		
		public function XMLDBData(target:IEventDispatcher=null)
		{
			//TODO: implement function
			super(target);
		}
		
		public function get articleId():int { return _articleId; }
		public function get departmentId():int { return _departmentId; }
		public function get userId():String { return _userId; }
		public function get data():String { return _data; }
		public function get state():int { return _state; }
		public function get dataHashkey():String { return _dataHashkey; }
		
		public function set articleId(value:int):void { setVariables(value,_departmentId,_userId,_data,_state,_dataHashkey); }
		public function set departmentId(value:int):void { setVariables(_articleId,value,_userId,_data,_state,_dataHashkey); }
		public function set userId(value:String):void { setVariables(_articleId,_departmentId,value,_data,_state,_dataHashkey); }
		public function set data(value:String):void { setVariables(_articleId,_departmentId,_userId,value,_state,_dataHashkey); }
		public function set state(value:int):void { setVariables(_articleId,_departmentId,_userId,_data,value,_dataHashkey); }
		public function set dataHashkey(value:String):void { setVariables(_articleId,_departmentId,_userId,_data,_state,value); }
		

		public function setVariables(articleId:int=-1,departmentId:int=-1,userId:String=null,data:String=null,state:int=1,dataHashkey:String=null):void
		{
						
			_articleId = (articleId)?articleId:null;
			_departmentId = (departmentId)?departmentId:null;
			_userId = (userId)?userId:null;
			_data = (data)?data:null;
			_state = (state)?state:null;
			_dataHashkey = (dataHashkey)?dataHashkey:null;
			
			super.update();
		}

		override public function toString():String
		{
					return "{articleId:"+_articleId+",departmentId:"+_departmentId+",userId:"+_userId+",data:"+_data+",state:"+_state+",dataHashkey:"+_dataHashkey+"}";
		}
	}
}